<include file="Public:html" />

<link href="../Public/css/member.css" media="screen" rel="stylesheet" type="text/css">
<script type="text/javascript">
$(document).ready(function(){
    $('#alipay').click(function(){
        $('#selectbank').attr('style','display:none');
        $('#isbank').attr('style','display:none');
        $('#showpaytype').html('<img class="vam" src="../Public/images/alipay.jpg" />');
        $('#showpaytip').html('<p>采用支付宝方式充值</p>');
    });

    $('#yeepay').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/yeepay.gif" />');
        $('#showpaytip').html('<p>采用易宝支付方式充值</p>');
    });

    $('#chinabank').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/chinabank.jpg" />');
        $('#showpaytip').html('<p>采用网银在线方式充值</p>');
    });

    $('#tenpay').click(function(){
        //$('#selectbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        //$('#isbank').attr('style','display:inline');//先屏蔽易宝的银行选择功能
        $('#showpaytype').html('<img class="vam" src="../Public/images/tenpay.gif" />');
        $('#showpaytip').html('<p>采用财付通方式充值</p>');
    });

    <eq name="tenpay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/tenpay.gif" />');
		$('#showpaytip').html('<p>采用财付通方式充值</p>');
		selectPaytype(4);
	</eq>
    <eq name="chinabank.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/alipay.jpg" />');
		$('#showpaytip').html('<p>采用支付宝方式充值</p>');
		selectPaytype(3);
	</eq>	
	<eq name="yeepay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/yeepay.gif" />');
        $('#showpaytip').html('<p>采用易宝支付方式充值</p>');
		selectPaytype(2);
	</eq>
	<eq name="alipay.state" value="1">
		$('#showpaytype').html('<img class="vam" src="../Public/images/alipay.jpg" />');
		$('#showpaytip').html('<p>采用支付宝方式充值</p>');
		selectPaytype(1);
	</eq>
});


//发送用户充值点卡的操作
function send_cardform(){
    productname = $('#productname').attr('value');
    paytype = $('#paytype').attr('value');
    orderprice = $('#orderprice').attr('value');
    ordersn = $('#ordersn').attr('value');
    oid = $('#oid').attr('value');
    ptype = $('#type').attr('value');
    id = $('#tid').attr('value');
    $.post(APP+"/Member/ajax_prepay",
    {
    'paytype':paytype,
    'oid':oid
    },
    function(data,success){
		if(data!='0'){
			paylink = data;
			addDialogbox("#mb_pay","您确认支付本信息吗?",10003,550);
			var content=$('#payinfotext').html();
			var msg='<div id="highlightTips"><img class="sprite sprite_highlightTips" src="/website/Tpl/clear/Public/images/sprites/sprite.gif" /> 系统将会在新打开的窗口上支付操作！支付操作完成前请不要关闭此窗口。</div>'+
					'<div id="paybtn" class="tc" style="display:block">'+
						'<span class="button">'+
							'<span class="first-child">'+
								'<button type="button" onclick="mb_pay_yes(\''+paylink+'\');">确认支付</button>'+
							'</span>'+
						'</span>'+
						'<span class="button">'+
							'<span class="first-child">'+
								'<button type="button" onclick="mb_pay_no();">返回编辑</button>'+
							'</span>'+
						'</span>'+
					'</div>'+
					'<div id="waitbtn" class="tc" style="display:none">'+
						'<span class="button">'+
							'<span class="first-child">'+
								'<button type="button" onclick="mb_pay_ok();">我已支付完成了,返回用户首页</button>'+
							'</span>'+
						'</span>'+
					'</div>';
			$("#mb_pay .dialogboxContent").html("<p>"+content+"</p>"+msg);
		}
    });
}

function mb_pay_ok(){
    parent.gotourl("/Member/index");
}
function mb_pay_no(){
    removeDialogbox("#mb_pay");
}

function mb_pay_yes(goUrl){
    window.open(goUrl,'_blank');
    $('#waitbtn').attr('style','display:inline');
    $('#paybtn').attr('style','display:none');
    //$('#waitbtn').submit();
}

//银行的类型
function selsectbank(b){
    $('#showbanktype').html('&lt;img class="vam" src="../Public/images/'+b+'.jpg" /&gt;');
}

function selectPaytype(n){
    $('#paytype').attr('value',n);
}

function payGoback(oid){
    location.href = APP+'/Member/showOrder/id/'+oid;
}
</script>

 
</head><body onclick="parent.iframeAutoHeight('orderFrame');" class="skin" id="paiban">
<form  id="checkout" method="post" action="__APP__/Member/checkout/">
<input type="hidden" value="{$orderdata.id}" id="oid" name="oid">
<div class="clearfix regWrap">

    <fieldset id="orderInfo">
        <legend>未支付订单 (编号:{$orderdata.ordersn})</legend>
        <table>
            <tbody><tr>
                <th width="45%">商品</th>
                <th width="18%">成交时间</th>
                <th width="18%">保留时间</th>
                <th width="19%">成交价</th>
            </tr>

            <tr>
                <td>
                    <a  href="{:U('/Auction/detail/id/'.$orderdata['aid'])}" title="{$orderdata.goodsname}"><img  alt="{$orderdata.goodsname}" src="__PUBLIC__/accessory/img/{$orderdata.thumbnail}" /></a>
                    <a  class="displayBlock" href="{:U('/Auction/detail/id/'.$orderdata['aid'])}" title="{$orderdata.goodsname}">{$orderdata.goodsname}{$orderdata.sn}</a>
                </td>
                <td class="f10">{$orderdata.addtime|date='Y-m-d H:i:s',###}</td>
                <td class="f10">{$orderdata.ordertime|date='Y-m-d H:i:s',###}</td>
                <td><strong class="price">&yen;
                        <eq name="orderdata['type']" value="0">{$orderdata.goodsprice}</eq>
                        <eq name="orderdata['type']" value="1">{$orderdata.realprice}</eq>
                    </strong>
                </td>
            </tr>
        <eq name="orderdata['type']" value="0">
            <tr class="freightList">
                <td class="tr" colspan="3">补差价：</td>
                <td><strong class="price">
                - &yen;{$orderdata.premium}</strong></td>
            </tr>
            <tr class="freightList">
                <td class="tr" colspan="3">运费：</td>
                <td><strong class="price">
                + &yen;{$orderdata.goodsfreight}</strong></td>
            </tr>
            <!--<tr>
                <td class="tr" colspan="3">发票快递费(?)：</td>
                <td><strong class="price">+ ¥0</strong>
                </td>
            </tr>
            -->
        </eq>
            <tr>
                <td class="tr" colspan="3">您需要为订单支付：</td>
                <td><strong class="keyword f16">&yen;{$orderdata.orderprice}</strong></td>
            </tr>
        </tbody></table>
    </fieldset>

    <fieldset>
        <legend>收件人详情</legend>
        <p class="paragraph">
        <span class="space">
            收货人: <span class="text">{$orderdata.recipient}</span>
        </span>
        <span class="space">
            手机或电话: <span class="text">{$orderdata.tel}</span>
        </span>
        <span class="space">
            邮编: <span class="text">{$orderdata.postalcode}</span>
        </span>
        </p>
        <p class="paragraph">
        <span class="space">
            收货地址: <span class="text">{$orderdata.address}</span>
        </span>
        <span class="space">
            备注: <span class="text">{$orderdata.remark}</span>
        </span> 
        </p>
    </fieldset>

    <input type="hidden" value="1" id="paytype" name="paytype">
        <fieldset class="paymentType">
            <legend>支付方式</legend>
            <ul>
                <li <eq name="alipay.state" value="0">style="display:none"</eq>>
                    <input type="radio" onclick="javascript:selectPaytype(1);" checked="" value="0" class="radio" name="paytype" id="alipay">
                    <label for="alipay"><img src="../Public/images/alipay.jpg" class="vam"></label>
                </li>
                <li <eq name="yeepay.state" value="0">style="display:none"</eq>>
                    <input type="radio" onclick="javascript:selectPaytype(2);" class="radio" value="1" name="paytype" id="yeepay">
                    <label for="yeepay"><img src="../Public/images/yeepay.gif" class="vam"></label>
                </li>
                <li <eq name="chinabank.state" value="0">style="display:none"</eq>>
	                <input id="chinabank" name="paytype"  value="2" class="radio"  type="radio"  onClick="javascript:selectPaytype(3);" />
	                <label for="chinabank"><img class="vam" src="../Public/images/chinabank.jpg" /></label>
	            </li>
	            <li <eq name="tenpay.state" value="0">style="display:none"</eq>>
	                <input id="tenpay" name="paytype"  value="4" class="radio"  type="radio"  onClick="javascript:selectPaytype(4);" />
	                <label for="tenpay"><img class="vam" src="../Public/images/tenpay.gif" /></label>
	            </li>
            </ul>
        </fieldset>

        <fieldset style="display: none;" id="selectbank" class="paymentType">
            <legend>选择银行 <span class="keyword">（将会新窗口打开网上银行页面）</span></legend>
            <ul>
                <li>
                    <input type="radio" checked="" value="cmb" class="radio" name="banktype" id="cmb">
                    <label onclick="selsectbank('cmb');" for="cmb"><img src="../Public/images/cmb.jpg" class="vam"></label>
                </li>
                <li>
                    <input type="radio" value="bc" class="radio" name="banktype" id="bc">
                    <label onclick="selsectbank('bc');" for="bc"><img src="../Public/images/bc.jpg" class="vam"></label>
                </li>
                <li>
                    <input type="radio" value="abc" class="radio" name="banktype" id="abc">
                    <label onclick="selsectbank('abc');" for="abc"><img src="../Public/images/abc.jpg" class="vam"></label>
                </li>
                <li>
                    <input type="radio" value="icbc" class="radio" name="banktype" id="icbc">
                    <label onclick="selsectbank('icbc');" for="icbc"><img src="../Public/images/icbc.jpg" class="vam"></label>
                </li>
                <li>
                    <input type="radio" value="ccb" class="radio" name="banktype" id="ccb">
                    <label onclick="selsectbank('ccb');" for="ccb"><img src="../Public/images/ccb.jpg" class="vam"></label>
                </li>
            </ul>
        </fieldset>

        <fieldset class="paymentType">
            <legend>提示信息</legend>
            <p id="showpaytip"></p>
        </fieldset>
        
        <div class="tc" id="gotoBuy">
            <p id="payinfotext">
                <span class="space">您一共需要支付：<strong id="showprice" class="keyword">&yen;{$orderdata.orderprice}</strong></span>
                <span class="space">支付方式：<strong id="showpaytype"><img src="../Public/images/alipay.jpg" class="vam"></strong></span>
                <span style="display: none;" id="isbank">网上银行：<strong id="showbanktype"><img src="../Public/images/cmb.jpg" class="vam"></strong></span>
            </p>

        </div>


    <div class="clearfix fl" id="notetip"></div>
    
    <div id="orderSubmitButton">
            <p class="paragraph">
              <span class="button">
                  <span class="first-child">
                      <button onclick="javascript:payGoback({$orderdata.id});" class="strong" type="button">上一步，返回编辑</button>
                  </span>
              </span>
                <span class="button button-hilite">
                    <span class="first-child">
                        <button onclick="send_cardform();" class="strong" type="button">下一步，在线支付</button>
                    </span>
                </span>
            </p>
    </div>
    
</div>
</form>

</body></html>